export class OrderData {
    static getLastOrderID():string{
        let list = OrderData.getOrderIDList();
        return list.pop();
    }

    private static getOrderIDList():Array<string>{
        let strData= cc.sys.localStorage.getItem("order_id_list");
        if(strData==null || strData == "") {
            return [];
        }
        else {
            let orderList = JSON.parse(strData);
            return orderList;
        }
    }

    static setLastOrderID(orderid:string){
        let list = OrderData.getOrderIDList();
        list.push(orderid);
        cc.sys.localStorage.setItem("order_id_list",JSON.stringify(list));
    }

    static deleteLastOrderID(){
        let list = OrderData.getOrderIDList();
        list.pop();
        cc.sys.localStorage.setItem("order_id_list",JSON.stringify(list));
    }
}